﻿<%@ Page Language="C#" AutoEventWireup="true"  CodeFile="main.aspx.cs" Inherits="main" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title>ERP出版管理系统</title>
     <link type="text/css" rel="stylesheet" rev="stylesheet" href="css/StyleSheet.css" />
    <style type="text/css">
        .style1
        {
        }
        .style2
        {
            width: 388px;
        }
#winpop { width:300px; height:0px; position:absolute; right:0; bottom:0; border:1px solid #666; margin:0; padding:1px; overflow:hidden; display:none;}
#winpop .title { width:100%; height:22px; line-height:20px; background:#FFCC00; font-weight:bold; text-align:center; font-size:12px;}
#winpop .con { width:100%; height:200px; line-height:80px; font-weight:bold; font-size:12px; color:#FF0000; text-decoration:underline; text-align:center}
#silu { font-size:12px; color:#666; position:absolute; right:0; text-align:right; text-decoration:underline; line-height:22px;}
.close { position:absolute; right:4px; top:-1px; color:#FFF; cursor:pointer}
    </style>
</head>
<script language="javascript" type="text/javascript">
    window.setInterval(doJob, 15000);
    function doJob() {
        
        PageMethods.returnWarning("", onWarning);
        //alert("预警成功！");
    }
    function onWarning(result) {
        var rsArray = result.split("~");
        var alresult = "";
        for (var i = 0; i < rsArray.length; i++) {
            alresult += rsArray[i];
        }
        if(alresult!=""){
            document.getElementById('winpop').style.height = '0px';
            tips_pop();
        }
        
        //alert(alresult);
    }

    function showWarning() {
        window.showModalDialog("showWarningWindow.aspx", null, "dialogWidth=900px;dialogHeight=500px;status=no;help=no;scrollbars=no");
    
    }
    
    function openUrl(url,rightsId) {
    
        if (url!="") {
           //alert(url);
            var sw, sh, left, top;
    if (screen.width != 800) { sw = window.screen.width; sh = window.screen.height; }
    left = (screen.width - sw) / 2;
    top = (screen.height - sh) / 2;
    sh = sh - 60;
    sw = sw - 8;
    var orgSelPage = url;
  window.open(url, "_blank", "toolbar=no,location=no,directories=no,status=yes,resizable=no,menubar=no,scrollbars=yes,left=" + left + ",top=" + top + ",height=" + sh + ",width=" + sw);

       // self.window.open(url, "_blank", 'left=0,top=10,height=768,width=1024,null,toolbar=no,menubar=no,scrollbars=yes,resizable=no,location=no,status=no');
        }
    }
    
    function window.onunload() {
        //ret = confirm("确认离开当前页面吗？");
        //if(ret){
            document.getElementById("modifyUserStatus").click();
        //}
        
        //window.open("logout.aspx ", "self "); //调用事件
        }
        function tips_pop() {
            var MsgPop = document.getElementById("winpop");
            var popH = parseInt(MsgPop.style.height); //将对象的高度转化为数字
            if (popH == 0) {
                MsgPop.style.display = "block"; //显示隐藏的窗口
                show = setInterval("changeH('up')", 2);
            }
            else {
                hide = setInterval("changeH('down')", 2);
            }
        }
        function changeH(str) {
            var MsgPop = document.getElementById("winpop");
            var popH = parseInt(MsgPop.style.height);
            if (str == "up") {
                if (popH <= 100) {
                    MsgPop.style.height = (popH + 4).toString() + "px";
                }
                else {
                    clearInterval(show);
                }
            }
            if (str == "down") {
                if (popH >= 4) {
                    MsgPop.style.height = (popH - 4).toString() + "px";
                }
                else {
                    clearInterval(hide);
                    MsgPop.style.display = "none";  //隐藏DIV
                }
            }
        }
//        window.onload = function() {//加载
//            document.getElementById('winpop').style.height = '0px';
//            setTimeout("tips_pop()", 800); //3秒后调用tips_pop()这个函数
//        }
</script>

<body> 
    <form id="mainform" runat="server">
    <asp:ScriptManager ID="ScriptManager1" runat="server" EnablePageMethods="true">
        </asp:ScriptManager>
    <div class="bg">
        <div class="hd" style="background-image: url('image/headerwidth.gif')">
            
            
            <table style="width:100%; height: 95px; border:0;" >
                <tr>
                    <td class="style1">
                        
                        <asp:Button ID="modifyUserStatus" style="display:none;"
                            runat="server" Text="用户状态" onclick="modifyUserStatus_Click" />
                        &nbsp;</td>
                </tr>
                
            </table>
           
            
        </div>
        <div class="ct" >
            <div class="sideBar" >
               
                <asp:TreeView ID="TreeView1" runat="server"  ExpandDepth="0" 
                    ShowLines="True">
                <NodeStyle Font-Names="Tahoma" Font-Size="8pt" ForeColor="Black" 
                HorizontalPadding="5px" NodeSpacing="0px" VerticalPadding="1px" />
                </asp:TreeView>
               
            </div>
            <div class="rt" style="background-image: url('image/center.JPG')">
            </div>
            <div class="ft">
                <font size="2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;北京磨铁文化发展有限公司 当前用户:<%=Session["userName"] %>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font></div>
        </div>        
    </div> 
    <div id="winpop">
<div class="title">您有新的短消息！<span class="close" onclick="tips_pop()">X</span></div>
    <div class="con">
        <a href="#" onclick="showWarning();return false;">您有未读信息</a> 
        
    
    </div>
</div>      
    </form>
</body>
</html>


